import axios from "axios";

// 角色列表参数
export interface RoleParams {
    roleId: number;
    roleName: string;
    roleKey: string;
    roleSort: string;
    roleDesc: string;
}

// 角色修改参数
export interface EditRoleParams {
    roleId: number;
    roleDesc: string;
}

// 获取角色列表
export function roleList(paramsData: RoleParams) {
    return axios.get('/role/list', {params: paramsData});
}

// 获取角色下拉框列表
export function selectRoleList(roleName: string) {
    return axios.get('/role/select', {params: {roleName: roleName}});
}

// 根据角色id查询角色
export function getRoleById(roleId: number) {
    return axios.get(`/role/query/${roleId}`);
}

// 修改角色信息
export function edit(data: EditRoleParams) {
    return axios.put('/role/edit', data);
}
